package com.catersystem.zmy.catersystem.bean;

import android.text.TextUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 单据
 * Created by Administrator on 2017/7/20 0020.
 */

public class BehindBillsBean {


    /**
     * id : 202
     * cname : 004
     * status : 占用
     * opentime : 1512445032
     * detail_uncompleted : [{"id":"693","item_name":"海鲜2","spunit":"份","amount":"1.00","taste":"","status":"0",
     * "operatime":"1512445040"},{"id":"694","item_name":"果盘5","spunit":"份","amount":"1.00","taste":"","status":"0",
     * "operatime":"1512445040"},{"id":"695","item_name":"果盘4","spunit":"份","amount":"1.00","taste":"","status":"0",
     * "operatime":"1512445040"}]
     * detail_completed : [{"id":"603","item_name":"其他","spunit":"份","amount":"2.00","taste":"","status":"2",
     * "operatime":"1511942124"}]
     */

    private String id;
    private String cname;
    private String status;
    private long opentime;
    private List<DetailUncompletedBean> detail_uncompleted;
    private List<DetailUncompletedBean> detail_completed;
    private String time;

    public String getTime() {
        if (TextUtils.isEmpty(time)) {
            return "";
        }
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public long getOpentime() {
        return opentime;
    }

    public void setOpentime(long opentime) {
        this.opentime = opentime;
    }

    public List<DetailUncompletedBean> getDetail_uncompleted() {
        if (detail_uncompleted == null) {
            detail_uncompleted = new ArrayList<>();
        }
        return detail_uncompleted;
    }

    public void setDetail_uncompleted(List<DetailUncompletedBean> detail_uncompleted) {
        this.detail_uncompleted = detail_uncompleted;
    }

    public List<DetailUncompletedBean> getDetail_completed() {
        if (detail_completed == null) {
            detail_completed = new ArrayList<>();
        }
        return detail_completed;
    }

    public void setDetail_completed(List<DetailUncompletedBean> detail_completed) {
        this.detail_completed = detail_completed;
    }

    public static class DetailUncompletedBean {
        /**
         * id : 693
         * item_name : 海鲜2
         * spunit : 份
         * amount : 1.00
         * taste :
         * status : 0
         * operatime : 1512445040
         */

        private String id;
        private String item_name;
        private String spunit;
        private String amount;
        private String taste;
        private String status;
        private String operatime;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getItem_name() {
            return item_name;
        }

        public void setItem_name(String item_name) {
            this.item_name = item_name;
        }

        public String getSpunit() {
            return spunit;
        }

        public void setSpunit(String spunit) {
            this.spunit = spunit;
        }

        public String getAmount() {
            if (Float.parseFloat(amount) % 1 == 0) {
                return ((int) Float.parseFloat(amount)) + "";
            }
            return amount;
        }

        public void setAmount(String amount) {
            this.amount = amount;
        }

        public String getTaste() {
            return taste;
        }

        public void setTaste(String taste) {
            this.taste = taste;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getOperatime() {
            return operatime;
        }

        public void setOperatime(String operatime) {
            this.operatime = operatime;
        }
    }

}
